﻿<UserControl x:Class="Jbe.TestSuite.TestDevices.Manager.Presentation.TestDevicesView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:cal="http://www.codeplex.com/CompositeWPF"
    xmlns:cae="http://www.codeplex.com/CompositeExtensions"
    xmlns:i="http://www.codeplex.com/CompositeExtensions/TestSuite/Interface"
    xmlns:p="clr-namespace:Jbe.TestSuite.TestDevices.Manager.Properties"
    xmlns:tdi="clr-namespace:Jbe.TestSuite.TestDevices.Interface;assembly=Jbe.TestSuite.TestDevices.Interface"
    cae:ResourceService.MergeSharedDictionaries="{x:Static i:ResourceHelper.SharedResourcePath}">
    
    <DockPanel>
        <StackPanel DockPanel.Dock="Top">
            <ToolBar>
                <Button x:Name="newButton">
                    <Button.ContextMenu>
                        <ContextMenu cal:RegionManager.RegionName="{x:Static tdi:TestDeviceManagerRegionNames.NewDeviceMenuItems}"/>
                    </Button.ContextMenu>
                    <StackPanel Orientation="Horizontal">
                        <Image Source="../Resources/cog_add.png" ToolTip="{x:Static p:Resources.NewDevice}" Width="16" Height="16" Margin="0,0,2,0"/>
                        <TextBlock Text="{x:Static p:Resources.NewDevice}" VerticalAlignment="Center"/>
                    </StackPanel>
                </Button>
                <Button Command="{Binding OpenDeviceCommand}">
                    <Image Source="../Resources/cog_edit.png" ToolTip="{x:Static p:Resources.OpenDevice}" Width="16" Height="16"/>
                </Button>
                <Button Command="{Binding RemoveDeviceCommand}">
                    <Image Source="../Resources/cog_delete.png" ToolTip="{x:Static p:Resources.RemoveDevice}" Width="16" Height="16"/>
                </Button>
            </ToolBar>
        </StackPanel>

        <ListBox x:Name="controlDevicesList" ItemsSource="{Binding ControlViews}" SelectionMode="Extended" SelectionChanged="ControlDevicesListSelectionChanged" MouseDoubleClick="ControlDevicesListMouseDoubleClick">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Margin="3,3,3,6">
                        <TextBlock Text="{Binding Name}" FontWeight="Bold"/>
                        <TextBlock Text="{Binding Device.ProductName}"/>
                        <TextBlock Text="{Binding Device.Manufacturer}"/>
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </DockPanel>
</UserControl>
